{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7fec1e7a",
   "metadata": {},
   "source": [
    "## 搜索POI 2.0  \n",
    "\n",
    "### 产品概述  \n",
    "> 地点搜索服务2.0是一类Web API接口服务；服务提供多种场景的地点搜索能力，包括关键字搜索、周边搜索、多边形区域搜索、ID搜索。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "06afa500",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（打开一个google chrome 浏览器）\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "f09eac72",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 请求方法 ： GET\n",
    "# 3. 请求地理编码URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/text?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"8a58c8075687673efd0e4941e9c5145c\",\n",
    "    \"keywords\":\"广东省广州市从化区广州南方学院\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ea96516e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '广州南方学院',\n",
       "   'id': 'B00140MR9A',\n",
       "   'location': '113.679257,23.632577',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'typecode': '141201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉大道882号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院(西北门)',\n",
       "   'id': 'B00141JCWL',\n",
       "   'location': '113.672172,23.643307',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'typecode': '991400',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉大道882',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学校',\n",
       "   'id': 'B0FFLJHE1C',\n",
       "   'location': '113.540170,23.489713',\n",
       "   'type': '科教文化服务;学校;职业技术学校',\n",
       "   'typecode': '141206',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '广从北路468号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-菜园',\n",
       "   'id': 'B0HKMCAXU6',\n",
       "   'location': '113.679255,23.632569',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-南方湖',\n",
       "   'id': 'B0HKMCAOJ3',\n",
       "   'location': '113.679070,23.630299',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-蓝池',\n",
       "   'id': 'B0HKVD6S7U',\n",
       "   'location': '113.678982,23.633184',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路7号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-专家楼',\n",
       "   'id': 'B0HKMC8BU3',\n",
       "   'location': '113.678599,23.635728',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-音乐楼',\n",
       "   'id': 'B0HRVOG33Z',\n",
       "   'location': '113.678787,23.635358',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院-戏剧排练室',\n",
       "   'id': 'B0HKDCZORS',\n",
       "   'location': '113.680717,23.630655',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'typecode': '140000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州南方学院惟贤门',\n",
       "   'id': 'B0HGD580NZ',\n",
       "   'location': '113.678437,23.633721',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'typecode': '141201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '博学路7号附近',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f4267dd0",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 请求方法 ： GET\n",
    "# 3. 请求地理编码URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/text?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"8a58c8075687673efd0e4941e9c5145c\",\n",
    "    \"types\":\"020600\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f63d3437",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1', 'info': 'OK', 'infocode': '10000', 'pois': [], 'count': '0'}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3ff68468",
   "metadata": {},
   "source": [
    "### 周边搜索"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4a00162",
   "metadata": {},
   "source": [
    "* 周边搜索 API 服务地址  \n",
    "> URL:https://restapi.amap.com/v5/place/around?parameters"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1f5fe9de",
   "metadata": {},
   "source": [
    "* 获取中餐厅、西餐厅、快餐厅的信息(图片、内容等)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "90b4535c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 中餐厅\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. 请求地理编码URL地址 ： https://restapi.amap.com/v5/place/around?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"8a58c8075687673efd0e4941e9c5145c\",\n",
    "    \"keywords\":\"中餐厅\",\n",
    "    \"location\":\"113.678437,23.633721\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "54f27344",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '港渝好粥道',\n",
       "   'id': 'B0H64DILIJ',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'typecode': '050118',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '耀记美食',\n",
       "   'id': 'B0GRGOTLSL',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院明辩路2号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '庄海烧腊店',\n",
       "   'id': 'B0G3MR1ULG',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '陈记鱼庄',\n",
       "   'id': 'B0G3AGA9GN',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '湘味小厨',\n",
       "   'id': 'B0GKHC2KQN',\n",
       "   'location': '113.679283,23.632572',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '东记乡村美食',\n",
       "   'id': 'B0G3APADKJ',\n",
       "   'location': '113.679283,23.632572',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '珍味烧鹅',\n",
       "   'id': 'B0GKSDK3I1',\n",
       "   'location': '113.679291,23.632574',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '广州南方学院博学路6号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '无饿猪肚汤饭(中大店)',\n",
       "   'id': 'B0G3FCLIZ4',\n",
       "   'location': '113.676500,23.631722',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '王牌烤肉拌饭',\n",
       "   'id': 'B0H1M7YDQH',\n",
       "   'location': '113.680126,23.631492',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇中山大学南方学院综合楼',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '精品沙县(中大店)',\n",
       "   'id': 'B0G3AOJXUX',\n",
       "   'location': '113.676059,23.631942',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'typecode': '050118',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "efd6d915",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "de252b9a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "      <th>type</th>\n",
       "      <th>typecode</th>\n",
       "      <th>pname</th>\n",
       "      <th>cityname</th>\n",
       "      <th>adname</th>\n",
       "      <th>address</th>\n",
       "      <th>pcode</th>\n",
       "      <th>citycode</th>\n",
       "      <th>adcode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>港渝好粥道</td>\n",
       "      <td>B0H64DILIJ</td>\n",
       "      <td>113.679405,23.632673</td>\n",
       "      <td>餐饮服务;中餐厅;特色/地方风味餐厅</td>\n",
       "      <td>050118</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>耀记美食</td>\n",
       "      <td>B0GRGOTLSL</td>\n",
       "      <td>113.679405,23.632673</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院明辩路2号</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>庄海烧腊店</td>\n",
       "      <td>B0G3MR1ULG</td>\n",
       "      <td>113.679405,23.632673</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>050300</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>陈记鱼庄</td>\n",
       "      <td>B0G3AGA9GN</td>\n",
       "      <td>113.679405,23.632673</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>湘味小厨</td>\n",
       "      <td>B0GKHC2KQN</td>\n",
       "      <td>113.679283,23.632572</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>东记乡村美食</td>\n",
       "      <td>B0G3APADKJ</td>\n",
       "      <td>113.679283,23.632572</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>珍味烧鹅</td>\n",
       "      <td>B0GKSDK3I1</td>\n",
       "      <td>113.679291,23.632574</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>050300</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>广州南方学院博学路6号</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>无饿猪肚汤饭(中大店)</td>\n",
       "      <td>B0G3FCLIZ4</td>\n",
       "      <td>113.676500,23.631722</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>王牌烤肉拌饭</td>\n",
       "      <td>B0H1M7YDQH</td>\n",
       "      <td>113.680126,23.631492</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇中山大学南方学院综合楼</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>精品沙县(中大店)</td>\n",
       "      <td>B0G3AOJXUX</td>\n",
       "      <td>113.676059,23.631942</td>\n",
       "      <td>餐饮服务;中餐厅;特色/地方风味餐厅</td>\n",
       "      <td>050118</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          name          id              location                type typecode  \\\n",
       "0        港渝好粥道  B0H64DILIJ  113.679405,23.632673  餐饮服务;中餐厅;特色/地方风味餐厅   050118   \n",
       "1         耀记美食  B0GRGOTLSL  113.679405,23.632673        餐饮服务;中餐厅;中餐厅   050100   \n",
       "2        庄海烧腊店  B0G3MR1ULG  113.679405,23.632673        餐饮服务;快餐厅;快餐厅   050300   \n",
       "3         陈记鱼庄  B0G3AGA9GN  113.679405,23.632673        餐饮服务;中餐厅;中餐厅   050100   \n",
       "4         湘味小厨  B0GKHC2KQN  113.679283,23.632572        餐饮服务;中餐厅;中餐厅   050100   \n",
       "5       东记乡村美食  B0G3APADKJ  113.679283,23.632572        餐饮服务;中餐厅;中餐厅   050100   \n",
       "6         珍味烧鹅  B0GKSDK3I1  113.679291,23.632574        餐饮服务;快餐厅;快餐厅   050300   \n",
       "7  无饿猪肚汤饭(中大店)  B0G3FCLIZ4  113.676500,23.631722        餐饮服务;中餐厅;中餐厅   050100   \n",
       "8       王牌烤肉拌饭  B0H1M7YDQH  113.680126,23.631492        餐饮服务;中餐厅;中餐厅   050100   \n",
       "9    精品沙县(中大店)  B0G3AOJXUX  113.676059,23.631942  餐饮服务;中餐厅;特色/地方风味餐厅   050118   \n",
       "\n",
       "  pname cityname adname                              address   pcode citycode  \\\n",
       "0   广东省      广州市    从化区               温泉镇广州南方学院后门润泰超市1层05号商铺  440000      020   \n",
       "1   广东省      广州市    从化区                       温泉镇广州南方学院明辩路2号  440000      020   \n",
       "2   广东省      广州市    从化区               温泉镇广州南方学院后门润泰超市1层05号商铺  440000      020   \n",
       "3   广东省      广州市    从化区               温泉镇广州南方学院后门润泰超市1层05号商铺  440000      020   \n",
       "4   广东省      广州市    从化区               温泉镇广州南方学院后门润泰超市1层05号商铺  440000      020   \n",
       "5   广东省      广州市    从化区               温泉镇广州南方学院后门润泰超市1层05号商铺  440000      020   \n",
       "6   广东省      广州市    从化区                          广州南方学院博学路6号  440000      020   \n",
       "7   广东省      广州市    从化区  温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031  440000      020   \n",
       "8   广东省      广州市    从化区                       温泉镇中山大学南方学院综合楼  440000      020   \n",
       "9   广东省      广州市    从化区  温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031  440000      020   \n",
       "\n",
       "   adcode  \n",
       "0  440117  \n",
       "1  440117  \n",
       "2  440117  \n",
       "3  440117  \n",
       "4  440117  \n",
       "5  440117  \n",
       "6  440117  \n",
       "7  440117  \n",
       "8  440117  \n",
       "9  440117  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "046bca70",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 西餐厅\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. 请求地理编码URL地址 ： https://restapi.amap.com/v5/place/around?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"8a58c8075687673efd0e4941e9c5145c\",\n",
    "    \"keywords\":\"西餐厅\",\n",
    "    \"location\":\"113.678437,23.633721\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "3e70c210",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': 'Uni-hotel西餐',\n",
       "   'id': 'B0GR3OMDZ2',\n",
       "   'location': '113.679222,23.632671',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉区广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '碧泉空中温泉酒店西餐厅',\n",
       "   'id': 'B0FFHE6NL2',\n",
       "   'location': '113.654605,23.646045',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉东路76号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '米斯特比萨',\n",
       "   'id': 'B0FFKT17JQ',\n",
       "   'location': '113.698059,23.611033',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇石坑村东儒队00762号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '都喜泰丽温泉度假酒店泰丽西餐厅',\n",
       "   'id': 'B0FFFZX3VN',\n",
       "   'location': '113.716006,23.695553',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '飘香扒房(三饭三楼店)',\n",
       "   'id': 'B0HROCLI4W',\n",
       "   'location': '113.614664,23.581619',\n",
       "   'type': '餐饮服务;外国餐厅;牛扒店(扒房)',\n",
       "   'typecode': '050211',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '环市东路1123号梅花园',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '唐凰音乐主题餐吧',\n",
       "   'id': 'B0IG7KM4X0',\n",
       "   'location': '113.618768,23.559583',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '灌村路与环市东路交叉口东南60米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '白水寨嘉华酒店峰景西餐厅',\n",
       "   'id': 'B0FFI1WX57',\n",
       "   'location': '113.769390,23.556179',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '增城区',\n",
       "   'address': '白水寨嘉华温泉酒店内',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440118'},\n",
       "  {'name': '卡哇谊西餐厅(新城东路店)',\n",
       "   'id': 'B0FFH83K97',\n",
       "   'location': '113.590408,23.546459',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '新城东路25号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '品爵西餐厅',\n",
       "   'id': 'B0HRMSIB3H',\n",
       "   'location': '113.590299,23.546525',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '新城东路与新城东路二巷交叉口西北60米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '尚悦西餐厅',\n",
       "   'id': 'B0IGSU48XX',\n",
       "   'location': '113.591447,23.544403',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '河滨南路与中田东路交叉口北20米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b7fc944f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "0c4299f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "      <th>type</th>\n",
       "      <th>typecode</th>\n",
       "      <th>pname</th>\n",
       "      <th>cityname</th>\n",
       "      <th>adname</th>\n",
       "      <th>address</th>\n",
       "      <th>pcode</th>\n",
       "      <th>citycode</th>\n",
       "      <th>adcode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Uni-hotel西餐</td>\n",
       "      <td>B0GR3OMDZ2</td>\n",
       "      <td>113.679222,23.632671</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉区广州南方学院</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>碧泉空中温泉酒店西餐厅</td>\n",
       "      <td>B0FFHE6NL2</td>\n",
       "      <td>113.654605,23.646045</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>050200</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉东路76号</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>米斯特比萨</td>\n",
       "      <td>B0FFKT17JQ</td>\n",
       "      <td>113.698059,23.611033</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>050200</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>温泉镇石坑村东儒队00762号</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>都喜泰丽温泉度假酒店泰丽西餐厅</td>\n",
       "      <td>B0FFFZX3VN</td>\n",
       "      <td>113.716006,23.695553</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>飘香扒房(三饭三楼店)</td>\n",
       "      <td>B0HROCLI4W</td>\n",
       "      <td>113.614664,23.581619</td>\n",
       "      <td>餐饮服务;外国餐厅;牛扒店(扒房)</td>\n",
       "      <td>050211</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>环市东路1123号梅花园</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>唐凰音乐主题餐吧</td>\n",
       "      <td>B0IG7KM4X0</td>\n",
       "      <td>113.618768,23.559583</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>050200</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>灌村路与环市东路交叉口东南60米</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>白水寨嘉华酒店峰景西餐厅</td>\n",
       "      <td>B0FFI1WX57</td>\n",
       "      <td>113.769390,23.556179</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>050200</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>增城区</td>\n",
       "      <td>白水寨嘉华温泉酒店内</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>卡哇谊西餐厅(新城东路店)</td>\n",
       "      <td>B0FFH83K97</td>\n",
       "      <td>113.590408,23.546459</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>新城东路25号</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>品爵西餐厅</td>\n",
       "      <td>B0HRMSIB3H</td>\n",
       "      <td>113.590299,23.546525</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>新城东路与新城东路二巷交叉口西北60米</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>尚悦西餐厅</td>\n",
       "      <td>B0IGSU48XX</td>\n",
       "      <td>113.591447,23.544403</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>从化区</td>\n",
       "      <td>河滨南路与中田东路交叉口北20米</td>\n",
       "      <td>440000</td>\n",
       "      <td>020</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              name          id              location                 type  \\\n",
       "0      Uni-hotel西餐  B0GR3OMDZ2  113.679222,23.632671  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "1      碧泉空中温泉酒店西餐厅  B0FFHE6NL2  113.654605,23.646045       餐饮服务;外国餐厅;外国餐厅   \n",
       "2            米斯特比萨  B0FFKT17JQ  113.698059,23.611033       餐饮服务;外国餐厅;外国餐厅   \n",
       "3  都喜泰丽温泉度假酒店泰丽西餐厅  B0FFFZX3VN  113.716006,23.695553  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "4      飘香扒房(三饭三楼店)  B0HROCLI4W  113.614664,23.581619    餐饮服务;外国餐厅;牛扒店(扒房)   \n",
       "5         唐凰音乐主题餐吧  B0IG7KM4X0  113.618768,23.559583       餐饮服务;外国餐厅;外国餐厅   \n",
       "6     白水寨嘉华酒店峰景西餐厅  B0FFI1WX57  113.769390,23.556179       餐饮服务;外国餐厅;外国餐厅   \n",
       "7    卡哇谊西餐厅(新城东路店)  B0FFH83K97  113.590408,23.546459  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "8            品爵西餐厅  B0HRMSIB3H  113.590299,23.546525  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "9            尚悦西餐厅  B0IGSU48XX  113.591447,23.544403  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "\n",
       "  typecode pname cityname adname                     address   pcode citycode  \\\n",
       "0   050201   广东省      广州市    从化区                   温泉区广州南方学院  440000      020   \n",
       "1   050200   广东省      广州市    从化区                     温泉东路76号  440000      020   \n",
       "2   050200   广东省      广州市    从化区             温泉镇石坑村东儒队00762号  440000      020   \n",
       "3   050201   广东省      广州市    从化区  御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层  440000      020   \n",
       "4   050211   广东省      广州市    从化区                环市东路1123号梅花园  440000      020   \n",
       "5   050200   广东省      广州市    从化区            灌村路与环市东路交叉口东南60米  440000      020   \n",
       "6   050200   广东省      广州市    增城区                  白水寨嘉华温泉酒店内  440000      020   \n",
       "7   050201   广东省      广州市    从化区                     新城东路25号  440000      020   \n",
       "8   050201   广东省      广州市    从化区         新城东路与新城东路二巷交叉口西北60米  440000      020   \n",
       "9   050201   广东省      广州市    从化区            河滨南路与中田东路交叉口北20米  440000      020   \n",
       "\n",
       "   adcode  \n",
       "0  440117  \n",
       "1  440117  \n",
       "2  440117  \n",
       "3  440117  \n",
       "4  440117  \n",
       "5  440117  \n",
       "6  440118  \n",
       "7  440117  \n",
       "8  440117  \n",
       "9  440117  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "5a821086",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 快餐厅\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. 请求地理编码URL地址 ： https://restapi.amap.com/v5/place/around?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"8a58c8075687673efd0e4941e9c5145c\",\n",
    "    \"keywords\":\"西餐厅\",\n",
    "    \"location\":\"113.678437,23.633721\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "99cec2e4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': 'Uni-hotel西餐',\n",
       "   'id': 'B0GR3OMDZ2',\n",
       "   'location': '113.679222,23.632671',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉区广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '碧泉空中温泉酒店西餐厅',\n",
       "   'id': 'B0FFHE6NL2',\n",
       "   'location': '113.654605,23.646045',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉东路76号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '米斯特比萨',\n",
       "   'id': 'B0FFKT17JQ',\n",
       "   'location': '113.698059,23.611033',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇石坑村东儒队00762号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '都喜泰丽温泉度假酒店泰丽西餐厅',\n",
       "   'id': 'B0FFFZX3VN',\n",
       "   'location': '113.716006,23.695553',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '飘香扒房(三饭三楼店)',\n",
       "   'id': 'B0HROCLI4W',\n",
       "   'location': '113.614664,23.581619',\n",
       "   'type': '餐饮服务;外国餐厅;牛扒店(扒房)',\n",
       "   'typecode': '050211',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '环市东路1123号梅花园',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '唐凰音乐主题餐吧',\n",
       "   'id': 'B0IG7KM4X0',\n",
       "   'location': '113.618768,23.559583',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '灌村路与环市东路交叉口东南60米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '白水寨嘉华酒店峰景西餐厅',\n",
       "   'id': 'B0FFI1WX57',\n",
       "   'location': '113.769390,23.556179',\n",
       "   'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "   'typecode': '050200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '增城区',\n",
       "   'address': '白水寨嘉华温泉酒店内',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440118'},\n",
       "  {'name': '卡哇谊西餐厅(新城东路店)',\n",
       "   'id': 'B0FFH83K97',\n",
       "   'location': '113.590408,23.546459',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '新城东路25号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '品爵西餐厅',\n",
       "   'id': 'B0HRMSIB3H',\n",
       "   'location': '113.590299,23.546525',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '新城东路与新城东路二巷交叉口西北60米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '尚悦西餐厅',\n",
       "   'id': 'B0IGSU48XX',\n",
       "   'location': '113.591447,23.544403',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '河滨南路与中田东路交叉口北20米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "d8cfdb3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c8ad63e1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <td>Uni-hotel西餐</td>\n",
       "      <td>碧泉空中温泉酒店西餐厅</td>\n",
       "      <td>米斯特比萨</td>\n",
       "      <td>都喜泰丽温泉度假酒店泰丽西餐厅</td>\n",
       "      <td>飘香扒房(三饭三楼店)</td>\n",
       "      <td>唐凰音乐主题餐吧</td>\n",
       "      <td>白水寨嘉华酒店峰景西餐厅</td>\n",
       "      <td>卡哇谊西餐厅(新城东路店)</td>\n",
       "      <td>品爵西餐厅</td>\n",
       "      <td>尚悦西餐厅</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <td>B0GR3OMDZ2</td>\n",
       "      <td>B0FFHE6NL2</td>\n",
       "      <td>B0FFKT17JQ</td>\n",
       "      <td>B0FFFZX3VN</td>\n",
       "      <td>B0HROCLI4W</td>\n",
       "      <td>B0IG7KM4X0</td>\n",
       "      <td>B0FFI1WX57</td>\n",
       "      <td>B0FFH83K97</td>\n",
       "      <td>B0HRMSIB3H</td>\n",
       "      <td>B0IGSU48XX</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>location</th>\n",
       "      <td>113.679222,23.632671</td>\n",
       "      <td>113.654605,23.646045</td>\n",
       "      <td>113.698059,23.611033</td>\n",
       "      <td>113.716006,23.695553</td>\n",
       "      <td>113.614664,23.581619</td>\n",
       "      <td>113.618768,23.559583</td>\n",
       "      <td>113.769390,23.556179</td>\n",
       "      <td>113.590408,23.546459</td>\n",
       "      <td>113.590299,23.546525</td>\n",
       "      <td>113.591447,23.544403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>type</th>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>餐饮服务;外国餐厅;牛扒店(扒房)</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>typecode</th>\n",
       "      <td>050201</td>\n",
       "      <td>050200</td>\n",
       "      <td>050200</td>\n",
       "      <td>050201</td>\n",
       "      <td>050211</td>\n",
       "      <td>050200</td>\n",
       "      <td>050200</td>\n",
       "      <td>050201</td>\n",
       "      <td>050201</td>\n",
       "      <td>050201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pname</th>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cityname</th>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广州市</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>adname</th>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>增城区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "      <td>从化区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>address</th>\n",
       "      <td>温泉区广州南方学院</td>\n",
       "      <td>温泉东路76号</td>\n",
       "      <td>温泉镇石坑村东儒队00762号</td>\n",
       "      <td>御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层</td>\n",
       "      <td>环市东路1123号梅花园</td>\n",
       "      <td>灌村路与环市东路交叉口东南60米</td>\n",
       "      <td>白水寨嘉华温泉酒店内</td>\n",
       "      <td>新城东路25号</td>\n",
       "      <td>新城东路与新城东路二巷交叉口西北60米</td>\n",
       "      <td>河滨南路与中田东路交叉口北20米</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pcode</th>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "      <td>440000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>citycode</th>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "      <td>020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>adcode</th>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440118</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "      <td>440117</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                             0                     1                     2  \\\n",
       "name               Uni-hotel西餐           碧泉空中温泉酒店西餐厅                 米斯特比萨   \n",
       "id                  B0GR3OMDZ2            B0FFHE6NL2            B0FFKT17JQ   \n",
       "location  113.679222,23.632671  113.654605,23.646045  113.698059,23.611033   \n",
       "type       餐饮服务;外国餐厅;西餐厅(综合风味)        餐饮服务;外国餐厅;外国餐厅        餐饮服务;外国餐厅;外国餐厅   \n",
       "typecode                050201                050200                050200   \n",
       "pname                      广东省                   广东省                   广东省   \n",
       "cityname                   广州市                   广州市                   广州市   \n",
       "adname                     从化区                   从化区                   从化区   \n",
       "address              温泉区广州南方学院               温泉东路76号       温泉镇石坑村东儒队00762号   \n",
       "pcode                   440000                440000                440000   \n",
       "citycode                   020                   020                   020   \n",
       "adcode                  440117                440117                440117   \n",
       "\n",
       "                                   3                     4  \\\n",
       "name                 都喜泰丽温泉度假酒店泰丽西餐厅           飘香扒房(三饭三楼店)   \n",
       "id                        B0FFFZX3VN            B0HROCLI4W   \n",
       "location        113.716006,23.695553  113.614664,23.581619   \n",
       "type             餐饮服务;外国餐厅;西餐厅(综合风味)     餐饮服务;外国餐厅;牛扒店(扒房)   \n",
       "typecode                      050201                050211   \n",
       "pname                            广东省                   广东省   \n",
       "cityname                         广州市                   广州市   \n",
       "adname                           从化区                   从化区   \n",
       "address   御泉大道352号从化都喜泰丽温泉度假酒店餐饮中心1层          环市东路1123号梅花园   \n",
       "pcode                         440000                440000   \n",
       "citycode                         020                   020   \n",
       "adcode                        440117                440117   \n",
       "\n",
       "                             5                     6                     7  \\\n",
       "name                  唐凰音乐主题餐吧          白水寨嘉华酒店峰景西餐厅         卡哇谊西餐厅(新城东路店)   \n",
       "id                  B0IG7KM4X0            B0FFI1WX57            B0FFH83K97   \n",
       "location  113.618768,23.559583  113.769390,23.556179  113.590408,23.546459   \n",
       "type            餐饮服务;外国餐厅;外国餐厅        餐饮服务;外国餐厅;外国餐厅   餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "typecode                050200                050200                050201   \n",
       "pname                      广东省                   广东省                   广东省   \n",
       "cityname                   广州市                   广州市                   广州市   \n",
       "adname                     从化区                   增城区                   从化区   \n",
       "address       灌村路与环市东路交叉口东南60米            白水寨嘉华温泉酒店内               新城东路25号   \n",
       "pcode                   440000                440000                440000   \n",
       "citycode                   020                   020                   020   \n",
       "adcode                  440117                440118                440117   \n",
       "\n",
       "                             8                     9  \n",
       "name                     品爵西餐厅                 尚悦西餐厅  \n",
       "id                  B0HRMSIB3H            B0IGSU48XX  \n",
       "location  113.590299,23.546525  113.591447,23.544403  \n",
       "type       餐饮服务;外国餐厅;西餐厅(综合风味)   餐饮服务;外国餐厅;西餐厅(综合风味)  \n",
       "typecode                050201                050201  \n",
       "pname                      广东省                   广东省  \n",
       "cityname                   广州市                   广州市  \n",
       "adname                     从化区                   从化区  \n",
       "address    新城东路与新城东路二巷交叉口西北60米      河滨南路与中田东路交叉口北20米  \n",
       "pcode                   440000                440000  \n",
       "citycode                   020                   020  \n",
       "adcode                  440117                440117  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['pois']).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ea49b909",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
